package com.tanhua.app.controller;

import com.tanhua.app.service.TaoHuaService;
import com.tanhua.domain.vo.UserHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/*
- 语音匹配类似漂流瓶类似，可以发送匿名语音，可以收听匿名语音，收听完匿名语音可以选择喜欢或不喜欢。
- 如果双方互相喜欢那么可以配对成功互相关注
- 阿里云存储，设计mongo数据库表*/



@RestController
public class TaoHuaController {

    @Autowired
    private TaoHuaService taoHuaService;

    @GetMapping(name = "桃花传音接收",value = "/peachblossom")
    public ResponseEntity findPeachBlossom(){

        ResponseEntity soundVo = taoHuaService.findSound();
        return ResponseEntity.ok(soundVo);
    }

    @PostMapping(name = "桃花传音发送",value = "/peachblossom")
    public ResponseEntity sendPeachBlossom(MultipartFile soundFile){
        taoHuaService.sendSound(soundFile);
        return ResponseEntity.ok(null);
    }





}
